<template>
	<div class="bankcard-box">
		<ul class="bankcard-xinxi">
			<li>
				<router-link to="/zhifubaogl">
					<span>支付宝账户</span>
					<span v-text="banklist==false?'请添加支付宝':(banklist.bank_num.slice(0,2)+'****'+banklist.bank_num.slice(-4)+'('+banklist.account_name+')')"></span>
					<span><img src="../../img-order/icon_next@3x.png"/></span>
				</router-link>
			</li>
			<li>
				<span>提现金额</span>
				<span v-text="'￥'+jine">￥2700.00</span>
			</li>
		</ul>
		<ul class="bank-tel">
			<li><span>手机号码</span><span v-text="tel">188 8888 8888</span></li>
			<li>
				<span>验证码</span>
				<!--<input type="number" placeholder="请输入验证码" v-model="yzmnum"/>-->
				<i-input placeholder="请输入验证码" v-model="yzmnum" style="width: 2rem;height: 1rem;" />
				<span v-show="yzmstatus" @click="fsyzm">获取验证码</span>
				<span v-show="!yzmstatus" v-html="djsyzm">60秒后<br />重新发送</span>
			</li>
		</ul>
		<p class="banktijiao" @click="zfbtj">提交申请</p>
	</div>
</template>

<script>
	export default{
		data () {
			return{
				yzmstatus:true,
				banklist:'',
				tel:'',
				user:0,
				jine:0,
				djsyzm:'',
				yzmnum:''
			}
		},
		created:function(){
			this.user=localStorage.getItem("nt_user");
			this.jine=localStorage.getItem("nt_refundjine");
		},
		methods:{
			fsyzm:function(){
				var self=this;
				this.yzmstatus=false;
					self.djsyzm='60秒后<br />重新发送';
					for(var i=60;i>0;i--){
						(function(i){
							var a=i;
							var b=60;
							setTimeout(function(){
								self.djsyzm=b-a+'秒后<br />重新发送';
								if(a==60){
									self.yzmstatus=true;
								}
							},i*1000);
						})(i);
					};
				$.ajax({
					type:"post",
					url:furl+"index.php?app=ajax_epay&act=withdraw_tx",
					data:{'phone':self.tel},
					dataType:'json',
					success:function(res){
					}
				});
			},
			zfbtj:function(){
				var self=this;
				$.ajax({
					type:"post",
					url:furl+"index.php?app=ajax_epay&act=withdraw_new",
					data:{'token':self.user,'tx_money':self.jine,'phone_mob':self.tel,'post_zf_pass':self.yzmnum,'bank_id':self.banklist.bank_id},
					dataType:'json',
					success:function(res){
						if(res.done){
							localStorage.removeItem("nt_refundjine");
							layer.open({
							    content: '提现成功，等待管理员审核'
							    ,btn: '确定'
							  });
							history.go(-1);
						}
					}
				});
			}
		},
		mounted:function(){
			var self=this;
			$.ajax({
				type:'get',
				url:furl+'index.php?app=ajax_epay&act=withdraw_new',
				data:{'token':self.user,'bank_type':'2'},
				dataType:'json',
				success:function(res){
					if(res.done){
						self.banklist=res.retval.bank_list;
						self.tel=res.retval.phone_mob;
					}
				}
			})
		}
	}
</script>

<style>
	.bankcard-box{font-size:0;}
	.bankcard-xinxi{background-color:#fff;padding-left: 0.32rem;padding-right: 0.32rem;padding-top: 0.2rem;}
	.bankcard-xinxi>li{height:1rem;line-height: 1rem;border-bottom:1px solid #E8E8E8;}
	.bankcard-xinxi>li:last-child{border-bottom:none;}
	.bankcard-xinxi>li>a{display: block;}
	.bankcard-xinxi>li span:nth-child(1){font-size:0.28rem;color:#2E2E2E;display: inline-block;width:1.7rem;height:1rem;vertical-align:top;}
	.bankcard-xinxi>li span:nth-child(2){display:inline-block;font-size:0.32rem;color:#2E2E2E;width:4.5rem;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;}
	.bankcard-xinxi>li span:nth-child(3){float:right;}
	.bankcard-xinxi>li span:nth-child(3)>img{width:0.3rem;height:0.3rem;}
	
	.bank-tel{background-color:#fff;padding-left: 0.32rem;padding-right: 0.32rem;margin-top: 0.16rem;}
	.bank-tel>li{height:1rem;line-height: 1rem;border-bottom:1px solid #E8E8E8;}
	.bank-tel>li:last-child{border-bottom:none;}
	.bank-tel>li>span:nth-child(1){font-size:0.28rem;color:#2E2E2E;display: inline-block;width:1.7rem;}
	.bank-tel>li>span:nth-child(2){font-size:0.28rem;color:#2B2B2B;}
	.bank-tel>li>input{width:2rem;height:1rem;}
	.bank-tel>li>span:nth-child(3){font-size:0.28rem;color:#4C9D31;padding-left: 0.32rem;border-left:1px solid #A3A5A7;float:right;line-height: 0.3rem;margin-top: 0.35rem;}
	.bank-tel>li>span:nth-child(4){font-size:0.28rem;color:#999;padding-left: 0.32rem;border-left:1px solid #A3A5A7;float:right;line-height: 0.3rem;text-align: center;width:1.4rem;display: inline-block;margin-top: 0.2rem;}
	.banktijiao{margin: 0.6rem 0.32rem;height:1rem;text-align: center;line-height: 1rem;color:#fff;letter-spacing: 0.2rem;box-sizing: border-box;font-size:0.32rem;background-color:#5DB440;border-radius:0.5rem;padding-left: 0.6rem;}
</style>